   const path = require('path');

//错误日志输出完整路径
const errorLogPath = path.resolve(__dirname, "./logs/error/error");

//响应日志输出完整路径
const responseLogPath = path.resolve(__dirname, "./logs/response/response");

const _logConfig = {
    "appenders":
       [
           //错误日志
           {
               "category":"errorLogger",             //logger名称
               "type": "dateFile",                   //日志类型
               "filename": errorLogPath,             //日志输出位置
               "alwaysIncludePattern":true,          //是否总是有后缀名
               "pattern": "-yyyy-MM-dd-hh.log"       //后缀，每小时创建一个新的日志文件
           },
           //响应日志
           {
               "category":"resLogger",
               "type": "dateFile",
               "filename": responseLogPath,
               "alwaysIncludePattern":true,
               "pattern": "-yyyy-MM-dd-hh.log"
           }
       ],
       "levels":                                     //设置logger名称对应的的日志等级
       {
           "errorLogger":"ERROR",
           "resLogger":"ALL"
       }
};

const _config = {
    database: {
        DATABASE: '1214',
        USERNAME: 'root',
        PASSWORD: '1',
        PORT: '3306',
        HOST: 'rds4708143912z8xw567.mysql.rds.aliyuncs.com'
    }
};
const _secretKey = '123456';

module.exports = {
    config:_config,
    logConfig:_logConfig,
    secretKey:_secretKey,
};
// module.exports = logConfig;
